<?php
use yii\helpers\Html;
use yii\helpers\Url;
/* @var $this \yii\web\View */
/* @var $content string */

//\frontend\assets\MktWapCommonAsset::register($this);
?>

<script type="text/javascript">

function editStatus(id, status) {
	var args = {
		'classname': '\\common\\models\\MktPost',
		'funcname': 'editStatusAjax',
		'params': {
			'id':id,
            'status': status
		}
	};

	frmwebm.confirm({
		title:"下线贴子",
		content:"确认要将此贴下线?",
		url: "<?= Url::to(['/wap/ajax-broker']); ?>",
		type: "GET",
		data: "args=" + JSON.stringify(args),
		successFunc: function (resp) {
			if (resp['code'] != 0) {
				frmwebm.prompt({
					title: "友情提示",
					content: resp['data']
				});
				return;
			}
            location.reload();

			//frmwebm.prompt({
			//	title: "删除好友",
			//	content: "已成功删除...",
			//	reload: true
			//});
		},
		errorFunc: function () {
			//alert('send error');
		}
		//reload: true
		//afterClose: null,
	});
}

function editContent(id, post_type)
{
    if (post_type == 0) {
    	window.location.href="<?php echo Url::to(['wap/post-hezuo']); ?>&id=" + id;
    } else {
    	window.location.href="<?php echo Url::to(['wap/post-zhaopin']); ?>&id=" + id;
    }
}

</script>

<section class="page scr-page">
<div class="weui_panel weui_panel_access">
	<div class="weui_panel_bd">
        <?php echo yii\widgets\ListView::widget([
            'dataProvider' => $dataProvider,
            'itemView' => '_mypost_item',
            'layout' => "{items}\n{pager}\n",
            //'emptyText' => '',
            'emptyText' => '<div style="text-align:center;margin-top: 100px;"><span style="color:#666666 !important;margin-top: 150px;">你还没有发布过贴子<br><a href="' . Url::to(['/wap/post-add']) . '">现在就去发布一篇吧&gt;</a></span></div>',

            'pager' => [
                'firstPageLabel' => false,
                'lastPageLabel' => false,
                'prevPageLabel' => '上页',
                'nextPageLabel' => '下页',
                'maxButtonCount' => 0,
            ],

        ]) ?>
		
		<div class="weui_media_box weui_media_appmsg"></div>
	</div>
</div>
<div style="width:100%;height:55px;"></div>
</section>

<?php
/*
		<a href="" class="weui_media_box weui_media_appmsg">
			<div class="weui_media_hd">
				<img class="weui_media_appmsg_thumb" src="resources/images/avatar/tx.jpg" alt="">
			</div>
			<div class="weui_media_bd">
				<div class="weui_media_title"><span class="name">招聘市场经理</span></div>
				<p class="weui_media_desc">8-20</p>
			</div>
			<div style="float:right;">
                <input style="margin-top: -20px;" type="button" class="weui_btn weui_btn_mini weui_btn_default" value="下线"></input>
                <input style="margin-top: -20px;" type="button" class="weui_btn weui_btn_mini weui_btn_primary" value="编辑"></input>
            </div>
		</a>
		<a href="" class="weui_media_box weui_media_appmsg">
			<div class="weui_media_hd">
				<img class="weui_media_appmsg_thumb" src="resources/images/avatar/tx.jpg" alt="">
			</div>
			<div class="weui_media_bd">
				<div class="weui_media_title"><span class="name">寻沙画表演师</span></div>
				<p class="weui_media_desc">8-10</p>
			</div>
			<div style="float:right;">
                <input style="margin-top: -20px;" type="button" class="weui_btn weui_btn_mini weui_btn_default" value="下线"></input>
                <input style="margin-top: -20px;" type="button" class="weui_btn weui_btn_mini weui_btn_primary" value="编辑"></input>
            </div>
		</a>
		
		<a href="" class="weui_media_box weui_media_appmsg">
			<div class="weui_media_hd">
				<img class="weui_media_appmsg_thumb" src="resources/images/avatar/tx.jpg" alt="">
			</div>
			<div class="weui_media_bd">
				<div class="weui_media_title"><span class="name">寻沙画表演师</span></div>
				<p class="weui_media_desc">8-10</p>
			</div>
			<div style="float:right;">
                <input style="margin-top: -20px;" type="button" class="weui_btn weui_btn_mini weui_btn_default" value="下线"></input>
                <input style="margin-top: -20px;" type="button" class="weui_btn weui_btn_mini weui_btn_primary" value="编辑"></input>
            </div>
		</a>
		<a href="" class="weui_media_box weui_media_appmsg">
			<div class="weui_media_hd">
				<img class="weui_media_appmsg_thumb" src="resources/images/avatar/tx.jpg" alt="">
			</div>
			<div class="weui_media_bd">
				<div class="weui_media_title"><span class="name">寻沙画表演师</span></div>
				<p class="weui_media_desc">8-10</p>
			</div>
			<div style="float:right;">
                <input style="margin-top: -20px;" type="button" class="weui_btn weui_btn_mini weui_btn_default" value="下线"></input>
                <input style="margin-top: -20px;" type="button" class="weui_btn weui_btn_mini weui_btn_primary" value="编辑"></input>
            </div>
		</a>
		<a href="" class="weui_media_box weui_media_appmsg">
			<div class="weui_media_hd">
				<img class="weui_media_appmsg_thumb" src="resources/images/avatar/tx.jpg" alt="">
			</div>
			<div class="weui_media_bd">
				<div class="weui_media_title"><span class="name">寻沙画表演师</span></div>
				<p class="weui_media_desc">8-10</p>
			</div>
			<div style="float:right;">
                <input style="margin-top: -20px;" type="button" class="weui_btn weui_btn_mini weui_btn_default" value="下线"></input>
                <input style="margin-top: -20px;" type="button" class="weui_btn weui_btn_mini weui_btn_primary" value="编辑"></input>
            </div>
		</a>
		<a href="" class="weui_media_box weui_media_appmsg">
			<div class="weui_media_hd">
				<img class="weui_media_appmsg_thumb" src="resources/images/avatar/tx.jpg" alt="">
			</div>
			<div class="weui_media_bd">
				<div class="weui_media_title"><span class="name">寻沙画表演师2</span></div>
				<p class="weui_media_desc">8-10</p>
			</div>
			<div style="float:right;">
                <input style="margin-top: -20px;" type="button" class="weui_btn weui_btn_mini weui_btn_default" value="下线"></input>
                <input style="margin-top: -20px;" type="button" class="weui_btn weui_btn_mini weui_btn_primary" value="编辑"></input>
            </div>
		</a>
		<a href="" class="weui_media_box weui_media_appmsg">
			<div class="weui_media_hd">
				<img class="weui_media_appmsg_thumb" src="resources/images/avatar/tx.jpg" alt="">
			</div>
			<div class="weui_media_bd">
				<div class="weui_media_title"><span class="name">寻沙画表演师1</span></div>
				<p class="weui_media_desc">8-10</p>
			</div>
			<div style="float:right;">
                <input style="margin-top: -20px;" type="button" class="weui_btn weui_btn_mini weui_btn_default" value="下线"></input>
                <input style="margin-top: -20px;" type="button" class="weui_btn weui_btn_mini weui_btn_primary" value="编辑"></input>
            </div>
		</a>
		<a href="" class="weui_media_box weui_media_appmsg">
			<div class="weui_media_hd">
				<img class="weui_media_appmsg_thumb" src="resources/images/avatar/tx.jpg" alt="">
			</div>
			<div class="weui_media_bd">
				<div class="weui_media_title"><span class="name">寻沙画表演师0</span></div>
				<p class="weui_media_desc">8-10</p>
			</div>
			<div style="float:right;">
                <input style="margin-top: -20px;" type="button" class="weui_btn weui_btn_mini weui_btn_default" value="下线"></input>
                <input style="margin-top: -20px;" type="button" class="weui_btn weui_btn_mini weui_btn_primary" value="编辑"></input>
            </div>
		</a>
        <div class="<?php echo YII_ENV_DEV ? '' : 'hide' ?> ">
        <?php $form = ActiveForm::begin(['method' => 'post', 'id'=>'shadow_form']); ?>
            <?php $model = new \common\models\MktPost(); ?>
            <?php echo $form->field($model, 'id') -> textInput(['id' => 'post_id']) ?>
            <?php echo $form->field($model, 'status') -> textInput(['id' => 'post_status']) ?>
            <button type="button" id="test">Test...</button>
        <?php ActiveForm::end(); ?>
        </div>


*/